home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / MetalLabelUI.java < prev    next >
Text File  |  1998-06-30  |  2KB  |  67 lines

  1. /*
  2.  * @(#)MetalLabelUI.java    1.1 98/02/01
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. package com.sun.java.swing.plaf.metal;
  22.  
  23. import com.sun.java.swing.*;
  24. import com.sun.java.swing.plaf.*;
  25. import com.sun.java.swing.plaf.basic.*;
  26.  
  27.  
  28. import java.awt.*;
  29.  
  30.  
  31. /**
  32.  * A Windows L&F implementation of LabelUI.  This implementation 
  33.  * is completely static, i.e. there's only one UIView implementation 
  34.  * that's shared by all JLabel objects.
  35.  *
  36.  * @version 1.1 02/01/98
  37.  * @author Hans Muller
  38.  */
  39.  
  40. public class MetalLabelUI extends BasicLabelUI
  41. {
  42.     protected static MetalLabelUI metalLabelUI = new MetalLabelUI();
  43.  
  44.  
  45.     public static ComponentUI createUI(JComponent c) {
  46.     return metalLabelUI;
  47.     }
  48.  
  49.     /**
  50.      * Paint clippedText at textX, textY with background.lighter() and then 
  51.      * shifted down and to the right by one pixel with background.darker().
  52.      * 
  53.      * @see #paint
  54.      * @see #paintEnabledText
  55.      */
  56.     protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)
  57.     {
  58.     int accChar = l.getDisplayedMnemonic();
  59.     g.setColor(UIManager.getColor("Label.disabled"));
  60.     BasicGraphicsUtils.drawString(g, s, accChar, textX, textY);
  61.     }
  62.  
  63.  
  64.  
  65. }
  66.  
  67.